package io.kiki.sba.registry.server.clientInterface.remoting.handler;

import io.kiki.sba.registry.common.model.Node;
import io.kiki.sba.registry.server.clientInterface.bootstrap.ExecutorManager;
import io.kiki.sba.registry.server.clientInterface.strategy.AppRevisionHandlerStrategy;
import io.kiki.sba.registry.server.clientInterface.wrapper.BlacklistWrapperInterceptor;
import io.kiki.sba.registry.server.shared.remoting.AbstractServerHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.concurrent.Executor;

public abstract class AbstractClientMetadataRequestHandler<T> extends AbstractServerHandler<T> {
    private static final Logger logger = LoggerFactory.getLogger(BlacklistWrapperInterceptor.class);

    @Autowired
    protected ExecutorManager executorManager;
    @Autowired
    protected AppRevisionHandlerStrategy appRevisionHandlerStrategy;

    @Override
    protected Node.NodeType getConnectNodeType() {
        return Node.NodeType.client;
    }

    @Override
    public Executor getExecutor() {
        return executorManager.getAccessMetadataExecutor();
    }

    @Override
    public InvokeType getInvokeType() {
        return InvokeType.SYNC;
    }
}
